﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Xunit;

namespace dogd.Tests
{

	public class LikeFacts
	{
		public class TheToStringMethod
		{
			[Fact]
			public void WillIncludeTwoWildcardsIfValuesIsPlainText()
			{
				var like = new Like("Name", "Bob");

				Assert.Equal("Name LIKE \'%Bob%\'", like.ToString());
			}

			[Fact]
			public void WillMaintainWildcardIfValueContainsWildcardAtEnd()
			{
				var like = new Like("Name", "Bo%");

				Assert.Equal("Name LIKE \'Bo%\'", like.ToString());
			}

			[Fact]
			public void WillMaintainWildcardIfValueContainsTwoWildcards()
			{
				var like = new Like("Name", "%Bo%");

				Assert.Equal("Name LIKE \'%Bo%\'", like.ToString());
			}
		}
	}
}
